// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Widgets/SCompoundWidget.h"

#define M_PI 3.14159265358979323846
/**
 * 
 */
class LISTLIBRARY_API SCircularArc : public SCompoundWidget
{
public:
	SLATE_BEGIN_ARGS(SCircularArc)
	{}
	SLATE_END_ARGS()
	SCircularArc();
	/** Constructs this widget with InArgs */
	void Construct(const FArguments& InArgs);
	virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
	//获取距离椭圆圆心半径某个角度的坐标
	/**
	 * @brief 
	 * @param CenterX 圆心X轴坐标
	 * @param CenterY 圆心Y轴坐标
	 * @param Width 椭圆宽
	 * @param Height 椭圆高
	 * @param angle 角度
	 * @param InPoint 返回的坐标点
	 */
	void GetEllipseOuterPoint(float CenterX, float CenterY, float Width,float Height, float angle, FVector2D &InPoint) const;
public:
	//圆环距离圆心的距离
	float radius;
	//圆环的宽度
	float LoopWidth;
	//椭圆的圆心X
	float CenterX;
	//椭圆的圆心Y
	float CenterY;
	//背景颜色
	FLinearColor BkColor;
	//开始的角度
	float BeginAngle;
	//结束的角度
	float EndAngle;
	//最大值
	float MaXValue;
	//需要绘制的圆弧
	float DrawValue;
	//绘制的颜色
	FLinearColor DrawColor;
	//默认颜色
	TArray<FLinearColor> DefaultColor;
	//使用自定义颜色
	bool UseDefaultColor;
	
	//清晰度
	float Definition;
};
